#include "smart-device-manager.h"

int main(int argc, char const *argv[])
{

    string uartDevice = "/dev/ttyS0";
    SmartDeviceManager deviceManger(uartDevice);
    bool ok;
#if 0
    ok = deviceManger.openDoorlLock(0x00, 0x01);
    cout << "open door lock ok:" << ok << endl;


    ok = deviceManger.closeDoorlLock(0x00, 0x01);
    cout << "open door close ok:" << ok << endl;

    uint8_t lockState = 0;
    ok = deviceManger.queryDoorlLock(0x00, 0x01, lockState);
    cout << "open doorLock ok:" << ok << endl;
    cout << "open doorlock Lockstate  :" << lockState << endl;

    uint16_t temp;
    ok = deviceManger.querySensor(0x00, 0x00, temp);
    cout << "open doorLock ok:" << ok << endl;
    cout << "query sensor temp: " << temp << endl;
#endif

    vector<uint8_t> info;
    ok = deviceManger.sniffingDevice(0x02, 0x00, info);
    if (ok)
    {
        for (int i = 0; i < info.size(); i++)
        {
            printf("%02x ", info[i]);
        }
        printf("\n");
    }

    return 0;
}